all-dynamic-lin:
	g++ -g -o main_tinyxml main_tinyxml.cpp -I../tinyxml/tinyxml_header/ -L../tinyxml/tinyxml_bin/ -ltinyxml

all-dynamic-win:
	cp ../tinyxml/tinyxml_bin/libtinyxml.so ../tinyxml/tinyxml_bin/libtinyxml.dll #when linking, cygwin/g++ needs the libxxx.dll, but not libxxx.so, since it follows windows post fix 'dll' to find the -lxxx (cygwin/g++ -lxxx ==> libxxx.dll) but when the executable file is about to run, it will need the libxxx.so as the required dynamic library.
	g++ -g -o main_tinyxml main_tinyxml.cpp -I../tinyxml/tinyxml_header/ -L../tinyxml/tinyxml_bin/ -ltinyxml

exe-dynamic-lin: all-dynamic-lin
	LD_LIBRARY_PATH="../tinyxml/tinyxml_bin/" ./main_tinyxml	

exe-dynamic-win: all-dynamic-win
	cp ../tinyxml/tinyxml_bin/libtinyxml.so ./
	./main_tinyxml

all-static:
	g++ -g -o main_tinyxml main_tinyxml.cpp -I../tinyxml/tinyxml_header/ -L../tinyxml/tinyxml_bin/ -ltinyxml -static #-static is used to force g++ use static link firstly, but not use dynamic link by default.

exe-static: all-static
	./main_tinyxml

clean:
	rm -rf *~
	rm -rf main_tinyxml
	rm -f *.o
	rm -f *.tqs tca.*
	rm -rf core a.out pchdir
	rm -f *100* .inslog* .i* .z*
	rm -rf *.so
	rm -rf *.dll
